<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script type="text/javascript">
            function popup(pagina) {
                //alert('hola ' + pagina);                
                window.open(pagina,'1402953968202','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=300,top=10');
            }
        </script>
    </head>
    <body>

<script type="text/javascript">
            function popup(pagina) {
                //alert('hola ' + pagina);                
                window.open(pagina,'1402953968202','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=300,top=10');
            }
        </script>

<?php

include_once ('../includes/utilidades.php');
//include_once('../includes/config.php');
session_start();
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$objeto = $_REQUEST['nombreObjeto'];

$fin = false;

$valores = array();
foreach ($_REQUEST as $key => $value) {
    if ($key != 'nombreObjeto') {
        $valores[$key] = $value;
    }
}


if (sizeof($tablas['fkinfo'][$objeto]['fkTable']) > 0) {
    $next = $tablas['fkinfo'][$objeto]['fkTable'];
} else {
    exit;
}
//print_r ($next);
$lista = array();
while (!$fin) {

    if (!isset($tablas['fkinfo'][$next]['fkTable'])) {
        $lista[] = $next;
        $fin = true;
    } else {
        $lista[] = $next;
        $next = $tablas['fkinfo'][$next]['fkTable'];
    }
}

print_r($_SESSION);
foreach (array_reverse($lista) as $key => $val) {
    print "<h1>" . $val . " " . $_SESSION['estado'][$val][0]['nombre'] . "</h1>";
}

print "<html><body>";
//HTMLFormTablaAdd($objeto,$_SESSION['estado'],$tablas);
HTMLFormTablaAction($objeto, $tablas[$objeto], 'doAddObjeto.php',$valores);
//print session_id();
//print $_SESSION['afterAddcompeticion']
?>
</body></html>
